import dayjs from 'dayjs'

export function useFormatDate(
  date: any,
  format: string = 'YYYY-MM-DD HH:mm:ss'
) {
  const formatRes = dayjs(date).format(format)
  if (formatRes === 'Invalid Date') return ''
  return formatRes
}
